package com.xukai.springboot.controller.patient;

import com.xukai.springboot.entity.patient.*;
import com.xukai.springboot.entity.response.PageResult;
import com.xukai.springboot.entity.response.Patient.PatientResponse;
import com.xukai.springboot.entity.response.ResponseBase;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

@Api(basePath = "api/patient", description = "患者信息管理")
@RestController
@RequestMapping("api/patient/*")
public class PatientController {

    /**
     * 日志
     */
    private final Logger logger = LoggerFactory.getLogger(PatientController.class);

    /**
     * 获取患者列表
     */
    @ApiOperation(value = "获取患者列表", notes = "获取患者列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "StartIndex", value = "起始数据", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query"),
            @ApiImplicitParam(name = "PageSize", value = "起始数据", required = true, dataType = "int", example = "0",defaultValue ="0",  paramType = "query"),
            @ApiImplicitParam(name = "PatientName", value = "患者姓名", required = true, dataType = "string", paramType = "query")
    })
    @GetMapping("GetPatientList")
    public ResponseBase<PageResult<PatientResponse>> GetPatientList(@RequestParam int StartIndex, @RequestParam int PageSize, @RequestParam String PatientName) {

        ResponseBase<PageResult<PatientResponse>> result = new ResponseBase<>();
        try {
        } catch (Exception e) {
            logger.error("获取患者列表", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     * 修改患者信息
     */
    @ApiOperation(value = "修改患者信息", notes = "修改患者信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "Param", value = "患者信息", required = true, dataType = "t_patient", paramType = "body")
    })
    @PostMapping("EditPatient")
    public ResponseBase EditPatient(@RequestBody t_patient Param) {
        ResponseBase result = new ResponseBase();
        try {

        } catch (Exception e) {
            logger.error("修改患者信息", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     * 获取患者信息
     */
    @ApiOperation(value = "获取患者信息", notes = "获取患者信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "PatientID", value = "患者信息ID", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query")
    })
    @GetMapping("GetPatient")
    public ResponseBase<t_patient> GetPatient(@RequestParam int PatientID) {
        ResponseBase<t_patient> result = new ResponseBase<>();
        try {
        } catch (Exception e) {
            logger.error("获取患者信息", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     * 获取患者课程信息
     */
    @ApiOperation(value = "获取患者课程信息", notes = "获取患者课程信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "StartIndex", value = "检索起始数据", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query"),
            @ApiImplicitParam(name = "PageSize", value = "分页大小", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query")
    })
    @GetMapping("GetCourse")
    public ResponseBase<PageResult<t_patient_course>> GetCourse(@RequestParam int StartIndex, @RequestParam int PageSize) {
        ResponseBase<PageResult<t_patient_course>> result = new ResponseBase<>();
        try {

        } catch (Exception e) {
            logger.error("获取患者课程信息", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     * 获取患者训练计划信息
     */
    @ApiOperation(value = "获取患者训练计划信息", notes = "获取患者训练计划信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "StartIndex", value = "检索起始数据", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query"),
            @ApiImplicitParam(name = "PageSize", value = "分页大小", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query")
    })
    @GetMapping("GetTrains")
    public ResponseBase<PageResult<t_patient_trains>> GetTrains(@RequestParam int StartIndex, @RequestParam int PageSize) {
        ResponseBase<PageResult<t_patient_trains>> result = new ResponseBase<>();
        try {

        } catch (Exception e) {
            logger.error("获取患者课程信息", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     * 获取患者历史训练信息
     */
    @ApiOperation(value = "获取患者历史训练信息", notes = "获取患者历史训练信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "StartIndex", value = "检索起始数据", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query"),
            @ApiImplicitParam(name = "PageSize", value = "分页大小", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query")
    })
    @GetMapping("GetTrainsHistory")
    public ResponseBase<PageResult<t_patient_train_history>> GetTrainsHistory(@RequestParam int StartIndex, @RequestParam int PageSize) {
        ResponseBase<PageResult<t_patient_train_history>> result = new ResponseBase<>();
        try {

        } catch (Exception e) {
            logger.error("获取患者课程信息", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     * 获取患者订单信息
     */
    @ApiOperation(value = "获取患者订单信息", notes = "获取患者订单信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "StartIndex", value = "检索起始数据", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query"),
            @ApiImplicitParam(name = "PageSize", value = "分页大小", required = true, dataType = "int", example = "0",defaultValue ="0" , paramType = "query")
    })
    @GetMapping("GetOrders")
    public ResponseBase<PageResult<t_order>> GetOrders(@RequestParam int StartIndex, @RequestParam int PageSize) {
        ResponseBase<PageResult<t_order>> result = new ResponseBase<>();
        try {

        } catch (Exception e) {
            logger.error("获取患者课程信息", e);
            result.setStatue(0);
        }
        return result;
    }

    /**
     *
     */
}
